function checkit() {
	var rnt = true;
	if (isblank(document.form1.NAME)) {
		rnt = false;
		alert("请填写办公用品名称");
	} else if (isblank(document.form1.FL)) {
		rnt = false;
		alert("请填写办公用品分类");
	} else if (isblank(document.form1.UNIT)) {
		rnt = false;
		alert("请填写单位");
	}else if (!isinteger(document.form1.KC_NUM)) {
		rnt = false;
		alert("请填写正确的库存数量");
	} else if (!isfloat(document.form1.PRICE)) {
		rnt = false;
		alert("请填写正确的单价");
	}else if (isblank(document.form1.BG_DATE)) {
		rnt = false;
		alert("请填写变更时间");
	} 

	return rnt;
}

/**
 * 保存成功后回调函数
 */
function forwardFunc() {
	Ext.MessageBox.confirm('提示', '要继续增加新的内容吗？', function(e) {
				if (e == "yes") {
					handleRefresh();
				} else {
					window.location.href = context
							+ '/system/tablequery/jsplist.jsp?queryKey=bgyplist';
				}
			});
}

/**
 * 更新成功后回调函数
 */
function forwardFunc() {
	window.location.href = context
			+ '/system/tablequery/jsplist.jsp?queryKey=bgyplist';
}

/**
 * 初始化form表单项
 * 
 * @param {}
 *            json
 */
function initFunc(json) {
	
	if (json != null) {
		$('PK_ID').value = json.data.PK_ID;
		$('BGYP_DJRID').value = json.data.BGYP_DJRID;
		$('BGYP_DJRNAME').value = json.data.BGYP_DJRNAME;
		$('SFKY').value = json.data.SFKY;
		$('NAME').value = json.data.NAME;
		$('FL').value = json.data.FL;
		$('XH').value = json.data.XH;
		$('UNIT').value = json.data.UNIT;
		$('KC_NUM').value = json.data.KC_NUM;
		$('PRICE').value = json.data.PRICE;
		$('BGYP_DESC').value = json.data.BGYP_DESC;
		$('BG_DATE').value = formatDate(json.data.BG_DATE
				.substring(0, 8));
		initwordbook4select('fl', json.data.FL, 'FL', true);
	}else {
		initwordbook4select('fl', '', 'FL', true);
	}
}